package org.example.platform.design.simplefactory.version2.me;

import org.example.platform.design.simplefactory.version2.Futil;

public class MethodServiceImpl implements MethodService {
    @Override
    public double add(Integer num, Integer num2) {
        return num + num2;
    }

    @Override
    public double mult(Integer num, Integer num2) {
        return num * num2;
    }

    @Override
    public double reduce(Integer num, Integer num2) {
        return num - num2;
    }

    @Override
    public double except(Integer num, Integer num2) throws Exception {
        try{
            Futil.isNumNotZero(num);
        }catch (Exception e) {
            throw new Exception(e.getMessage());
        }
        return num / num2;
    }
}
